package com.zl.tby.vo;

import com.zl.tby.model.TbyJointDefence;
import lombok.Data;
import org.noear.solon.validation.annotation.Length;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.NotNull;

/**
 * 联防联控bean
 * @author sunjiaxing
 * @version 1.0
 * @since 2024/8/22 00:28
 */
@Data
public class TbyJointDefenceForm {

    /**主键id*/
    private Long id;
    /**标题*/
    @NotBlank(message = "标题不能为空")
    @Length(max = 20, message = "标题最大长度为20")
    private String title;
    /**类型*/
    @NotNull(message = "类型不能为空")
    private Integer type;
    /**内容*/
    private String content;
    /**是否上架*/
    private Integer publish;

    public TbyJointDefence createEntity() {
        TbyJointDefence entity = new TbyJointDefence();
        entity.setType(this.getType());
        entity.setTitle(this.getTitle());
        entity.setContent(this.getContent());
        entity.setPublish(0);
        return entity;
    }

    public void updateEntity(TbyJointDefence entity) {
        entity.setType(this.getType());
        entity.setTitle(this.getTitle());
        entity.setContent(this.getContent());
        entity.setContent(this.getContent());
    }
}
